home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / amphn180.lha / AmiPhone / Install_AmiPhone < prev    next >
Text File  |  1996-05-11  |  10KB  |  228 lines

  1. ; Installation script for AmiPhone
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiPhone...")
  5.  
  6. (if (exists "AmiTCP:" (noreq))
  7.  (
  8.     ; make sure "rx" is available
  9.     (if (not (exists "sys:rexxc/rx"))
  10.         (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  11.  
  12.     ; make sure we have the library that EditTextFile.rexx needs
  13.     (if (not (exists "libs:rexxsupport.library"))
  14.         (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
  15.  
  16.     ; try and make sure ARexx is running 
  17.     (run "rexxmast" (safe))
  18.  
  19.     ; if AmiPhoned is already in /serv, probably they've already installed before
  20.     (set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq)))
  21.  
  22.     ; don't want to make a distinction between 1 and 2
  23.     (if (> DefaultUpdate 0)    (set DefaultUpdate 1))
  24.     
  25.     (set PhoneUpdate
  26.           (askchoice
  27.              (prompt "Select which kind of install you want:")
  28.              (choices "First Time Install" "Update")
  29.              (default DefaultUpdate)
  30.              (help "If you've never installed AmiPhone on your system before, select First Time Install.  If you already have an earlier version, select Update.")
  31.        ))
  32.     
  33.     ; ask the user what kind of digitizer they use
  34.     (set Digitizer
  35.           (askchoice
  36.                (prompt "Select which type of audio digitizer you will be using with AmiPhone:")
  37.                (choices "GVP DSS8" "PerfectSound" "A.M.A.S." "Toccata (Zorro II)" "Aura (12-bit PCMCIA)" "Sound Magic" "Generic Parallel Port digitizer")
  38.                (default 6)
  39.                (help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port.  Although it often isn't necessary, AmiPhone likes to know what digitizer it is using.  If your digitizer model is not listed, please choose the Generic option.")
  40.           )
  41.     )
  42.     (select Digitizer
  43.         (set Digitizer "DSS8")
  44.         (set Digitizer "PERFECTSOUND")
  45.         (set Digitizer "AMAS")
  46.         (set Digitizer "TOCCATA")
  47.         (set Digitizer "AURA")
  48.         (set Digitizer "SOUNDMAGIC")
  49.         (set Digitizer "GENERIC")
  50.     )
  51.     (tooltype
  52.         (dest "AmiPhone")
  53.         (settooltype "SAMPLER" Digitizer)
  54.     )
  55.  
  56.     ; do they want to set up AmiPhone to receive voice-mail?
  57.     (if (= 1 (askbool 
  58.         (prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
  59.         (help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer.  This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
  60.         (default 0)
  61.         (choices "Yes" "No")))
  62.     ; answered yes
  63.     (
  64.         (set MessageDir 
  65.             (askdir
  66.                         (prompt "What directory would you like AmiPhone to keep the voice message files in?  (NOTE: You should not keep any other files in this directory!)")
  67.                             (help @askdir-help)
  68.                             (default "work:")))
  69.                 (set MaxDirSize
  70.                     (asknumber
  71.                         (prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be?  (Enter -1 for unlimited size)")
  72.                         (help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive.  AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
  73.                 (default 500)
  74.                 (range -1 1000000)))
  75.         
  76.         ; if a max size was set for the dir, use that as the max max file size as well
  77.         (if (> MaxDirSize -1)
  78.             (set MaxFileSize MaxDirSize)
  79.             (set MaxFileSize 1000000))
  80.         
  81.         (set MaxFileSize
  82.             (asknumber
  83.                 (prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be?  (Enter -1 to impose no special limit on individual message size)")
  84.                         (help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
  85.                 (default 100)
  86.                 (range -1 MaxFileSize)))
  87.                 (set AwayVar
  88.                     (askstring
  89.                         (prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away.  If the ENV: var is present, it takes a message, otherwise it puts up a requester for you.  What ENV: var would you like AmiPhone to look for?")
  90.                         (help "The ENV: var can be set manually by you, by a script, or often by your screen blanker.  Garshneblanker, for one, sets the ENV: var named BLANKED whenever the screen blanker is active.")
  91.                 (default "BLANKED")))
  92.         
  93.         ; set the tooltypes!    
  94.         (set BlankString "")
  95.  
  96.         (tooltype
  97.             (dest "AmiPhone")
  98.             (settooltype "VOICEMAILDIR" MessageDir))
  99.         (tooltype
  100.             (dest "AmiPhone")
  101.             (settooltype "AWAYVAR" AwayVar))
  102.  
  103.         (if (> MaxDirSize -1)
  104.         ((tooltype
  105.             (dest "AmiPhone")
  106.             (settooltype "MAXVOICEMAILSIZE" (cat BlankString MaxDirSize))))
  107.         ;else
  108.         ((tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))))
  109.         
  110.         (if (> MaxFileSize -1)    
  111.         ((tooltype
  112.             (dest "AmiPhone")
  113.             (settooltype "MAXMESSAGESIZE" (cat BlankString MaxFileSize))))
  114.         ;else
  115.         ((tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))))
  116.         
  117.     )
  118.     ; answered no
  119.     (
  120.         ; clean out any related tooltypes 
  121.         (tooltype (dest "AmiPhone") (settooltype "VOICEMAILDIR"))
  122.         (tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))
  123.         (tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))
  124.         (tooltype (dest "AmiPhone") (settooltype "AWAYVAR"))
  125.     ))
  126.     
  127.     (set PhoneDir
  128.         (askdir
  129.                     (prompt "What directory would you like to put the AmiPhone executable in?  (no directory will be created)")
  130.                         (help @askdir-help)
  131.                         (default "AmiTCP:bin")
  132.                 )
  133.         )
  134.  
  135.     ; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know
  136.     (if (not (PatMatch "Amitcp:bin" PhoneDir))
  137.        (
  138.         (run (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE"))
  139.         (run (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE"))
  140.        )
  141.     )
  142.     
  143.     ; Copy AmiPhone and AmiPhoned to the bin and serv directories 
  144.     (copyfiles
  145.         (prompt (cat "Copying AmiPhone executable to " PhoneDir))
  146.         (help @copyfiles-help)
  147.         (source "")
  148.         (infos)
  149.         (pattern "AmiPhone")
  150.         (dest PhoneDir)
  151.     )
  152.     
  153.     (copyfiles
  154.         (prompt "Copying AmiPhoned daemon to amitcp:serv")
  155.         (help @copyfiles-help)
  156.         (source "")
  157.         (infos)
  158.         (pattern "AmiPhoned")
  159.         (dest "amitcp:serv")
  160.     )
  161.  
  162.     ; If we're doing a first-time install, update the user's AmiTCP config files
  163.     (if (= 0 PhoneUpdate)    
  164.       (
  165.         (delete "t:edit_text_succeeded")
  166.         (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AmiPhone AmiPhone^^^^^^^^2956/tcp"))
  167.         (run
  168.             (ARexxRunString)
  169.             (prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  170.             (help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
  171.             (confirm)
  172.         )
  173.         (if (not (exists "t:edit_text_succeeded"))
  174.            (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  175.                     
  176.         (delete "t:edit_text_succeeded")
  177.         (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AmiPhone AmiPhone^^^^stream^^^^^^tcp^nowait^root^^^^amitcp:serv/AmiPhoned"))
  178.         (run
  179.             (ARexxRunString)
  180.             (prompt "\nAlso, the line:\n\nAmiPhone    stream      tcp nowait root    amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  181.             (help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
  182.             (confirm)
  183.         )
  184.         (if (not (exists "t:edit_text_succeeded"))
  185.            (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  186.       )
  187.     )
  188.     
  189.     ; make sure HOSTNAME is set; if not, warn the user
  190.     (if (not (exists "env:HOSTNAME"))
  191.        (
  192.         (if (= 1 (askbool 
  193.                 (prompt "\n\nThe ENV variable HOSTNAME does not appear to be set on your system.  AmiPhone needs this ENV variable to run correctly.  Would you like to set it now?")
  194.                 (help "If you know the Internet Host name of your Amiga, select 'Enter HOSTNAME Now' and type it in.  Your HOSTNAME should be something like mycomputer.mynetwork.mydomain (ex: sdcc8.ucsd.edu)  The string you type will be saved to the files env:HOSTNAME and envarc:HOSTNAME.")
  195.                 (default 1)
  196.                 (choices "Enter HOSTNAME now" "Skip This Part")
  197.                   )
  198.             )
  199.             (
  200.                 (set HostName (askstring 
  201.                         (prompt "Please enter your HOSTNAME in the box below.  You HOSTNAME should be something like mycomputer.mysystem.mydomain (for example, sdcc8.ucsd.edu)")
  202.                         (help @askstring-help)
  203.                           )
  204.             )
  205.                 (if (= 0 (strlen HostName))
  206.                     (message "You entered an empty HOSTNAME string.  I'll assume that you wished to skip this part.")
  207.                     (
  208.                         ; just in case, delete so that we can't ever have two lines in var
  209.                         (delete "env:HOSTNAME")
  210.                         (delete "envarc:HOSTNAME")
  211.                        (textfile
  212.                         (dest "ENV:HOSTNAME")
  213.                         (append HostName)    
  214.                     )
  215.                     (textfile
  216.                         (dest "ENVARC:HOSTNAME")
  217.                         (append HostName)    
  218.                     )
  219.                     )
  220.                 )
  221.             )
  222.         )
  223.        )
  224.     )
  225.     (message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
  226.  )
  227.  (abort "\n\nAmiTCP does not appear to be set up on your system.  (Specifically, the assign AmiTCP: has not been made)  Because of this, I am unable to install AmiPhone.  Please install AmiTCP and then try again.")
  228. )